<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <script>
    //特点：内层循环是外层循环的循环体。   
   //外层循环一次，内层循环全部。
        
        //用户输入几行几列小星星
        var num = prompt('想要打印几列小星星?');
        var num1 = prompt('想要打印几行小星星?');
        var str = '';
        for (let i = 0; i < num; i++) { // 对1的判断条件 几列
            for (let k = 0; k < num1; k++) {//对2的判断   一行几个
                str = str + '*';
            }
            str = str + '\n';
        }
        alert(str);
    </script>
</body>

</html>